package light.im.userserver.action;

import org.json.JSONArray;
import org.json.JSONObject;

import light.im.ActionName;
import light.im.IAction;
import light.im.IMSession;
import light.network.Protocol;
import light.network.object.PackObject;

@ActionName("friends")
public class UserFriendsAction implements IAction {

	@Override
	public void execute(IMSession session, PackObject req) {
		try
		{
			PackObject po = new PackObject();
			JSONObject h = po.getHeader();
			h.put("result", Protocol.OK);
			JSONArray frs = new JSONArray();
			frs.put(new JSONObject().put("id", "123456").put("name", "����"));
			frs.put(new JSONObject().put("id", "xxyy").put("name", "����"));
			h.put("friends", frs);
			
			session.write(po);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}

}
